#include<math.h>
int narcissistic(int number){
    int a = 0;
    int b = 0;
    int sum = 0;
    int s = number;
	while (s > 0){
		b = s % 10;
		s = s / 10;
		a++;
	}

	b = 0;
	s = number;
	while (s > 0){
		b = s % 10;
		s = s / 10;
		sum = pow(b, a) + sum;
	}
    if (sum == number){
        return 1;
    }
    else{
        return 0;
    }
}
 
void PrintN(int m, int n)
{
    int sum = m + 1;
    int b = 0;
    int man = 0;
    int cnt = 0;
    for (m = sum; m < n; m++){
        int s = m;
		while (s > 0){
			b = s % 10;
			s = s / 10;
			cnt++;
		}
		b = 0;
		s = m;
		while (s > 0){
			b = s % 10;
			s = s / 10;
			man+= pow(b, cnt);
		}
		cnt = 0;
		if (man == m){
			printf("%d\n", m);
		}
		man = 0;
    }
    return 0;
}
